<?php
require_once("../system/funciones_bd.php");
require_once("../system/sesion.class.php");
//Conexion base de datos local
$link = mysql_connect("localhost", "root", "");
$sesion = new sesion();
$usuario = $sesion->get("usuario");
if ($usuario == false) {
    header("Location: ../index.php");
} else {
    mysql_set_charset('utf8', $link);
    $idPaciente = $_GET['idusuario'];
    ?>
    <!DOCTYPE html>
    <html lang="de"><!-- use class="debug" here if you develope a template and want to check-->
        <head>
            <meta charset="UTF-8" />
            <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
            <!-- some meta tags, important for SEO"--> 
            <meta name="description" content="put a short description in here" />
            <meta name="keywords" content="put your important keywords in here" />
            <meta name="revisit-after" content="7 days" />
            <meta name="robots" content="index,follow" />

            <title>ForensicTooth v1.0</title>

            <link rel="stylesheet" href="../css/inuit_1.css" />
            <link rel="stylesheet" href="../css/fluid-grid16-1100px.css" />
            <link rel="stylesheet" href="../css/eve-styles.css" />
            <link rel="shortcut icon" href="../icon.png" />
            <link rel="apple-touch-icon-precomposed" href="../img/icon.png" />
            <link rel="stylesheet" href="../css/jquery-ui.css" />
            <style type="text/css">     
                @import url('../css/odontograma.css');
            </style>

            <script src="../js/jquery-1.9.1.js"></script>
            <script src="../js/jquery-ui.js"></script>            
            <script type="text/javascript" src="../js/odontograma.js"></script>
            <script src="../js/respond-min.js" type="text/javascript"></script>
        <script>
            $(function() {
                $("#dialog").dialog({
                    autoOpen: false,
                    modal: true
                });
                $(".abrir")
                        .button()
                        .click(function() {
                            $.ajax({
                                url: "odontogrmaDetalle.php?codigo=" + $(this).attr('codigo') + "&paciente=" + $(this).attr('paciente')
                            }).done(function(result) {
                                $("#dialog #contenido").html(result);
                            });
                            $("#dialog").dialog("open");
                        });
            });
        </script>
        <!--local fallback for JQuery-->

    </head>

    <!--===============================================================  Logo, social and menu =====================================================================================--> 
    <body>
        <div class="wrapper">   
            <a href="../index.php" id="logo"><img src="../img/logo.png" alt="something" />
                <h1 class="accessibility">ResponseEve, a responsive template by SiGa</h1></a>
            <div class="social">
                <h2>
                <?php echo $sesion->get("usuario"); ?> 
                </h2>
            </div>


            <ul id="nav" class="main">
                <li><a href="principalForence.php" class="active">Principal</a></li>
                <li><a href="../system/cerrarsesion.php">salir</a></li>
            </ul>

        </div><!--end of wrapper div--> 

        <div class="clear"></div>    
        <!--===============================================================  Intro =====================================================================================--> 
        <div class="wrapper">
            <div class="grids">
                <div style="text-align: center;">
                    <div id="contenido">
                        <div class="ui-separator ui-state-default ui-corner-all ui-widget-header">
                            <center>
                                <table style="width: 90%;" >
                                    <tr>
                                        <td colspan="18">
                                            <strong>Convenciones</strong>
                                            <hr />
                                        </td >
                                    </tr>
                                    <tr>
                                        <?php
                                        $link = mysql_connect("localhost", "root", "");
                                        mysql_set_charset('utf8', $link);
                                        mysql_select_db("sirpof_db1", $link);
                                        //var_dump($idPaciente);
                                        $resultRol = mysql_query("SELECT descripcionitem,formula FROM lista WHERE id_grupo = 2", $link);
                                        $i = 0;
                                        while ($rowRol = mysql_fetch_row($resultRol)) {
                                            echo "
                                      <td><center><div style='width: 50px;  he border: 1; background-color: " . $rowRol[1] . "; margin-left: 10px; '>&nbsp; &nbsp; &nbsp;</div></center></td>
                                      \n";
                                            $i++;
                                        }
                                        ?>
                                    </tr>
                                    <tr>
                                        <?php
                                        $link = mysql_connect("localhost", "root", "");
                                        mysql_set_charset('utf8', $link);
                                        mysql_select_db("sirpof_db1", $link);
                                        //var_dump($idPaciente);
                                        $resultRol = mysql_query("SELECT descripcionitem,formula FROM lista WHERE id_grupo = 2", $link);
                                        $i = 0;
                                        while ($rowRol = mysql_fetch_row($resultRol)) {
                                            echo "
                                      <td><center>" . $rowRol[0] . "</center></td>
                                      \n";
                                            $i++;
                                        }
                                        ?>
                                    </tr>
                                </table>
                            </center>
                        </div>
                        <br />
                        <center>
                            <!-- Contenido -->
                            <table style="width: 101%">
                                <tr>
                                    <!-- Primer fragmento-->
                                    <td style="border:  1px;">
                                        <div id="zona1">
                                            <div id="zona1_content" class="ui-datagrid-content">
                                                <table class="ui-datagrid-data">
                                                    <tr class="ui-datagrid-row">
                                                        <td class="ui-datagrid-column">
                                                    
                                                            <form><center>
                                                                <?php
                                                                
                                                                $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente 
                                                                                                FROM odontograma o 
                                                                                                inner join lista l on o.id_diente = l.idlista
                                                                                                INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                                INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                                WHERE o.activo = 1 
                                                                                                AND id_diente = 1 
                                                                                                AND po.id_paciente = $idPaciente", $link);

                                                                $i = 0;
                                                                while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                    echo  "<div><img src='../img/dientes/18.png' /></div>"
                                                                    . "<p class='abrir' codigo='" . $row1[1] . "' paciente='" . $row1[7] . "' >".$row1[0]."</p>"
                                                                    . "<div id='full'>";
                                                                    echo "
                                                                
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'><input type='hidden' value='" . $row1[2] . "' name='c1'/></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'><input type='hidden' value='" . $row1[3] . "' name='d1'/></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'><input type='hidden' value='" . $row1[4] . "' name='e1'/></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'><input type='hidden' value='" . $row1[5] . "' name='f1'/></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'><input type='hidden' value='" . $row1[6] . "' name='g1'/></div>
                                                                </div>  
                                                            </div><input type='hidden' value='" . $row1[7] . "' codigo2='" . $row1[7] . "' />
                                                             ";

                                                                    echo "  </div>\n";
                                                                    ?>
                                                                    <?php
                                                                }
                                                                ?>
                                                                </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form>
                                                                <center>
                                                                <?php
                                                                $resultHallazgo2 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o 
                                                                                        inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 2 
                                                                                        AND po.id_paciente = $idPaciente", $link);
                                                                $i = 0;
                                                                while ($row2 = mysql_fetch_row($resultHallazgo2)) {
                                                                    echo  "<div><img src='../img/dientes/17.png' /></div>"
                                                                    . "<p class='abrir' codigo='" . $row2[1] . "' paciente='" . $row2[7] . "'>".$row2[0]."</p>"
                                                                    . "<div id='full'>";

                                                                    echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row2[2] . "'><input type='hidden' value='" . $row2[2] . "' name='c1'/></div>
                                                                    <div id='d' style='background-color: " . $row2[3] . "'><input type='hidden' value='" . $row2[3] . "' name='d1'/></div>
                                                                    <div id='e' style='background-color: " . $row2[4] . "'><input type='hidden' value='" . $row2[4] . "' name='e1'/></div>
                                                                    <div id='f' style='background-color: " . $row2[5] . "'><input type='hidden' value='" . $row2[5] . "' name='f1'/></div>
                                                                    <div id='g' style='background-color: " . $row2[6] . "'><input type='hidden' value='" . $row2[6] . "' name='g1'/></div>
                                                                </div>
                                                            </div><input type='hidden' value='" . $row2[0] . "' name='iddiente2'/>
                                                            ";

                                                                    echo "  </div>\n";
                                                                    ?>
                                                                    <?php
                                                                }
                                                                ?></center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form>
                                                                    <center>
                                                            <?php
                                                            $resultHallazgo2 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o 
                                                                                        inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 3 
                                                                                        AND po.id_paciente = $idPaciente", $link);
                                                            $i = 0;
                                                            while ($row2 = mysql_fetch_row($resultHallazgo2)) {
                                                                echo  "<div><img src='../img/dientes/16.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row2[1] . "' paciente='".$row2[7]."'>".$row2[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row2[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row2[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row2[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row2[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row2[6] . "'></div>
                                                                </div>
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente3'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form>
                                                                    <center>
                                                            <?php
                                                            $resultHallazgo2 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o 
                                                                                        inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 4 
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row2 = mysql_fetch_row($resultHallazgo2)) {
                                                                echo  "<div><img src='../img/dientes/15-55.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row2[1] . "' paciente= '".$row2[7]."'>".$row2[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row2[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row2[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row2[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row2[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row2[6] . "'></div>
                                                                </div>
                                                                
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente4'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form>
                                                                    <center>
                                                            <?php
                                                            $resultHallazgo2 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 5
                                                                                        AND po.id_paciente = $idPaciente", $link);
                                                            $i = 0;
                                                            while ($row2 = mysql_fetch_row($resultHallazgo2)) {
                                                                echo  "<div><img src='../img/dientes/14-54.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row2[1] . "' paciente='".$row2[7]."'>".$row2[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row2[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row2[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row2[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row2[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row2[6] . "'></div>
                                                                </div>
                                                                
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente4'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form>
                                                                    <center>
                                                            <?php
                                                            $resultHallazgo2 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 6 
                                                                                        AND po.id_paciente = $idPaciente", $link);
                                                            $i = 0;
                                                            while ($row2 = mysql_fetch_row($resultHallazgo2)) {
                                                                echo  "<div><img src='../img/dientes/13-53.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row2[1] . "' paciente='".$row2[7]."'>".$row2[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row2[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row2[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row2[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row2[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row2[6] . "'></div>
                                                                </div>
                                                                
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente5'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                        </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form>
                                                                    <center>
                                                            <?php
                                                            $resultHallazgo2 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 7 
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row2 = mysql_fetch_row($resultHallazgo2)) {
                                                                echo  "<div><img src='../img/dientes/12-52.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row2[1] . "' paciente='".$row2[7]."'>".$row2[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row2[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row2[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row2[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row2[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row2[6] . "'></div>
                                                                </div>
                                                                
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente6'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form>
                                                                    <center>
                                                            <?php
                                                            $resultHallazgo2 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 8 
                                                                                        AND po.id_paciente = $idPaciente", $link);
                                                            $i = 0;
                                                            while ($row2 = mysql_fetch_row($resultHallazgo2)) {
                                                                echo  "<div><img src='../img/dientes/11-51.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row2[1] . "' paciente='".$row2[7]."'>".$row2[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row2[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row2[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row2[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row2[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row2[6] . "'></div>
                                                                </div>
                                                                
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente7'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </td>

                                    <!-- cierre del primer fragmento -->

                                    <!-- segundo fragmento-->


                                    <td>
                                        <div id="zona2" class="ui-datagrid ui-widget">
                                            <div id="zona2_content" class="ui-datagrid-content">
                                                <table class="ui-datagrid-data" style="width: 101%">
                                                    <tr class="ui-datagrid-row">
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $resultHallazgo2 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 9 
                                                                                        AND po.id_paciente = $idPaciente", $link);
                                                            $i = 0;
                                                            while ($row2 = mysql_fetch_row($resultHallazgo2)) {
                                                                echo  "<div><img src='../img/dientes/21-61.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row2[1] . "' paciente='".$row2[7]."'>".$row2[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row2[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row2[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row2[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row2[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row2[6] . "'></div>
                                                                </div>
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente7'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 10 
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo  "<div><img src='../img/dientes/22-62.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente7'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 11 
                                                                                        AND po.id_paciente = $idPaciente", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo  "<div><img src='../img/dientes/23-63.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row1[1] . "'  paciente='".$row1[7]."'>".$row1[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente7'/>  ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 12 
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo  "<div><img src='../img/dientes/24-64.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row1[1] . "'  paciente='".$row1[7]."'>".$row1[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente7'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 13 
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo  "<div><img src='../img/dientes/25-65.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row1[1] . "'  paciente='".$row1[7]."'>".$row1[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente7'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 14 
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo  "<div><img src='../img/dientes/26.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row1[1] . "'  paciente='".$row1[7]."'>".$row1[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente7'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 15 
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo  "<div><img src='../img/dientes/26.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row1[1] . "'  paciente='".$row1[7]."'>".$row1[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente7'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente = 16 
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo  "<div><img src='../img/dientes/28.png' /></div>"
                                                                . "<p class='abrir' codigo='" . $row1[1] . "'  paciente='".$row1[7]."'>".$row1[0]."</p>"
                                                                    . "<div id='full'>";

                                                                echo "
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                            </div>
                                                            <input type='hidden' value='" . $row2[0] . "' name='iddiente7'/> ";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </td>

                                    <!-- cierre del segundo fragmento -->
                                </tr>
                            </table>


                            
                            <hr id="j_idt175" class="ui-separator ui-state-default ui-corner-all ui-widget-header" title="Distal" /><table>
                                <tr>
                                    <td>

                                        <div style="width: 140px;"></div></td>
                                    <td>
                                        <div id="zona8" class="ui-datagrid ui-widget">
                                            <div id="zona8_content" class="ui-datagrid-content">
                                                
                                            </div>
                                        </div>
                                    </td>
                                    <td><div id="zona7" class="ui-datagrid ui-widget">
                                            <div id="zona7_content" class="ui-datagrid-content">
                                                
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div style="width: 140px;"></div></td>
                                </tr>
                            </table>
                            <table>
                                <tr>
                                    <td>
                                        <div id="zona4" class="ui-datagrid ui-widget">
                                            <div id="zona4_content" class="ui-datagrid-content">
                                                <table class="ui-datagrid-data" style="width: 101%">
                                                    <tr class="ui-datagrid-row">
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  17
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/48.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  18
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/47.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>

                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  19
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/46.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  20
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/45-85.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  21
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/44-84.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  22
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/43-83.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  23
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/42-82.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  24
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/41-81.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div id="zona3" class="ui-datagrid ui-widget">
                                            <div id="zona3_content" class="ui-datagrid-content">
                                                <table class="ui-datagrid-data" style="width: 101%">
                                                    <tr class="ui-datagrid-row">
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  25
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/31-71.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  26
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/32-72.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  27
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/33-73.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  28
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/34-74.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  29
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/35-75.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  30
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/36.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  31
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/37.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                        <td class="ui-datagrid-column">
                                                            <form method="POST" action="odontogrmaDetalle.php">
                                                                    <center>
                                                            <?php
                                                            $link = mysql_connect("localhost", "root", "");
                                                            mysql_select_db("sirpof_db1", $link);

                                                            $resultHallazgo1 = mysql_query("SELECT l.descripcionitem, l.idlista, lis_idhallazgo2, lis_idhallazgo3, lis_idhallazgo4, lis_idhallazgo5, lis_idhallazgo6, po.id_paciente
                                                                                        FROM odontograma o inner join lista l on o.id_diente = l.idlista
                                                                                        INNER JOIN paciente_odontograma po on po.id_registro = o.id_registro
                                                                                        INNER JOIN paciente p on p.id_paciente = po.id_paciente
                                                                                        WHERE o.activo = 1 
                                                                                        AND id_diente =  32
                                                                                        AND po.id_paciente = $idPaciente ", $link);
                                                            $i = 0;
                                                            while ($row1 = mysql_fetch_row($resultHallazgo1)) {
                                                                echo "<div id='full'>
                                                                <div id='x'>
                                                                    <div id='c' style='background-color: " . $row1[2] . "'></div>
                                                                    <div id='d' style='background-color: " . $row1[3] . "'></div>
                                                                    <div id='e' style='background-color: " . $row1[4] . "'></div>
                                                                    <div id='f' style='background-color: " . $row1[5] . "'></div>
                                                                    <div id='g' style='background-color: " . $row1[6] . "'></div>
                                                                </div>
                                                                <br />
                                                            </div><p class='abrir' codigo='" . $row1[1] . "' paciente='".$row1[7]."'>".$row1[0]."</p>";
                                                                        echo  "<div><img src='../img/dientes/38.png' /></div>";

                                                                echo "  </div>\n";
                                                                ?>
                                                                <?php
                                                            }
                                                            ?>
                                                                    </center>
                                                            </form>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <hr />
                        </center>


                    </div>

                    <a id="scroll-up" style="display: none;" onclick="scrollTo(0, 0)"></a>

                </div><!--end of div grids-->

            </div><!--end of div wrapper-->    

            <!--===============================================================  Footer =====================================================================================-->  
            <div class="wrapper">
                <div id="footer">


                    <div class="grids">
                        <center>
                            <p>ForensicTooth v 1.0</p>
                            </center>
                    </div><!--end of grids-->
                </div><!--end of footer-->
            </div><!--end of wrapper-->



    </body>
    </html>

    <?php
}
?>
